import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class product {
    private String id;
    private String name;
    private double price;

    public product(String id, String name, double price) {
        this.id = id;
        this.name = name;
        this.price = price;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public static void main(String[] args) {
        Map<String, product> products = new HashMap<String, product>();
        Scanner scanner = new Scanner(System.in);
        while (true) {
            System.out.println("用户输入商品ID添加新用品");
            System.out.println("list:用户浏览所有商品");
            System.out.println("请输入商品id---(exit退出)");
            String cmd=scanner.nextLine();
            switch (cmd){
                case "id":
                case "list":
                case "exit":

            }
            String id = scanner.nextLine();
            if (id.equals("exit")) {
                break;
            }
            System.out.println("请输入商品名称");
            String name = scanner.nextLine();
            System.out.println("请输入商品价格:");
            double price = scanner.nextDouble();
            product product = new product(id, name, price);
            products.put(id, product);


        }
    }
}
